package com.hello.web.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hello.web.domain.entity.RoleDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * @date 2025/2/25 10:40
 */
@Mapper
public interface RoleMapper extends BaseMapper<RoleDO> {


    default RoleDO findByName(String name) {
        LambdaQueryWrapper<RoleDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(RoleDO::getName, name);
        return selectOne(wrapper);
    }

}
